<?php

namespace App\Models\V1;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class LiveGiftListModels extends Model
{
    use SoftDeletes;
    protected $table    = 'live_gift_list';
    protected $fillable = ['name', 'price', 'img_url'];

    public function UpdateW($name, $price, $img_url)
    {
        if ($img_url) {
            return update([
                'name'    => $name,
                'price'   => $price,
                'img_url' => $img_url
            ]);
        } else {
            return update([
                'name'  => $name,
                'price' => $price,
            ]);
        }
    }
}
